#include "keycontroy.h"

extern int underlen, EshowLen;
extern int * EshowD;
void change(int type)
{
	for(int i = 0, j = 0; i < EshowLen; i++)
	{
			if(EshowD[i] == '?')
			{
				j++;continue;
			}
			if(j == underlen)	
			{
				if('*' <= EshowD[i] && EshowD[i] <= '/')
				{
					if(type == 0)
					{
						if(EshowD[i] == '+')
							EshowD[i]--;
						else
							if(EshowD[i] != '*')
								EshowD[i] -= 2;
					}
					if(type == 1)
					{
						if(EshowD[i] == '*')
							EshowD[i]++;
						else
							if(EshowD[i] != '/')
								EshowD[i] += 2;
					}
				}
				if('0' <= EshowD[i] && EshowD[i] <= '9')
				{
					
				}
			}
	}
}


void right_key(int len)
{
	if(underlen + 1 <= len)	underlen++; 
}

void left_key(int len)
{
	if(underlen > 1)	underlen--; 
}

void up_key()
{
	
}
void down_key()
{
	
}